<template>
<div>
  <div v-for="student in studentlist" :key="student.id">
    <p>{{student.name}}</p>
    <p>{{student.age}}</p>
    <p>{{student.grade}}</p>
  </div>

</div>
</template>

<script>
    export default {
        name: "Studentdetail",
      data(){
          return{
            studentlist:[],
            student_id:''
          }
      },
      methods:{
        getStudentDetail() {
          this.$axios.get('/app01/studentdetail/?student_id=' + this.student_id)
            .then(res => {
              console.log(res.data)
              this.studentlist=res.data
            })
        }
      },
      created() {
          this.student_id=this.$route.query.student_id
        this.getStudentDetail()
      }
    }
</script>

<style scoped>

</style>
